package com.chen.base.module.base.dto;

/**
 * @Title: manager-spring-mvc-hb
 * @Description: to do
 * @Author: chenjiwei
 * @Date: 2020-11-15 15:37
 * @Version: 1.0.0
 */
public class PageResponse<T> extends Response {
    private Integer total;

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public PageResponse(ResponseStatus code, Object data, Integer total){
        super(code, data);
        this.total = total;
    }
    public PageResponse(ResponseStatus code){
        super(code, null);
        this.total = 0;
    }
    public static PageResponse success(String message, Object data, Integer total){
        return new PageResponse(ResponseStatus.SUCCESS, data, total);
    }

    public static PageResponse fail(String message){
        return new PageResponse(ResponseStatus.FAIL);
    }
}
